import request from "../../../../utils/request";
export const service = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId ? "/event" : "/ttevent";
};
export const serviceDevice = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId
    ? "/device"
    : "/ttdevice";
};

export function findOrderAlarm(query) {
  return request({
    url: service() + "/alarm/type/findOrderAlarm",
    method: "post",
    data: query,
  });
}

export function getRegion(query) {
  return request({
    url: "/admin/video/getRegion",
    method: "post",
    data: query,
  });
}

export function getEnumInfo(query) {
  return request({
    url: "/admin/base/system/dict/data/dictType/" + query.enumTypeId,
    method: "get",
  });
}

export function getCustOrganTreeNew(query) {
  return request({
    url: "/admin/system/tenantDept/listSubsetDept",
    method: "post",
    data: query,
  });
}

export function queryTenantLabelList(query) {
  return request({
    url: serviceDevice() + "/video/device/queryTenantLabelList",
    method: "post",
    data: query,
  });
}

export function getDeviceList(query) {
  return request({
    url: serviceDevice() + "/video/device/getDeviceList",
    method: "post",
    data: query,
  });
}

export function qryWarningOrderCollection(query) {
  return request({
    url: service() + "/alarm/order/collection/qryWarningOrderCollection",
    method: "post",
    data: query,
  });
}

export function delWarningOrderCollection(query) {
  return request({
    url: service() + "/alarm/order/collection/delWarningOrderCollection",
    method: "post",
    data: query,
  });
}

export function grabProcessOrder(query) {
  return request({
    url: service() + "/alarm/processorder/grabProcessOrder",
    method: "post",
    data: query,
  });
}

export function getOrderList(query) {
  return request({
    url: service() + "/alarm/order/getOrderList",
    method: "post",
    data: query,
  });
}
export function getCollectionSourceByOrderId(data) {
  return request({
    url: service() + "/alarm/order/getCollectionSourceByOrderId",
    method: "post",
    data: data,
  });
}
